import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:get/get.dart';
import 'package:ichinesereader/exam/widgets/BGDashedRectWidget.dart';
import 'package:ichinesereader/exam/widgets/BGExamImageWidget.dart';
import 'package:ichinesereader/exam/widgets/BGRecorder.dart';
import 'package:ichinesereader/exam/widgets/BGSinglePlayer.dart';
import 'package:ichinesereader/utils/log.dart';
import 'package:ichinesereader/exam/widgets/SampleAudioPlayer.dart';
import 'package:ichinesereader/exam/dto/assessment.response.dart';
import 'ExamQuestionIndexPage.dart';
import 'controllers/ExamPageController.dart';

///
// Part 试卷章节， 最高级别的 章节
///
// ignore: must_be_immutable
class ExamQuestionPage extends GetView<ExamPageController> {
  ExamQuestionPage({Key? key, required this.questionStepBody}) : super(key: key);
  UiQuestionStepBody questionStepBody;
  Rx<String> radioGroupValue = ''.obs;

  var answerRadioEdgeInsetsGeometry = const EdgeInsets.symmetric(horizontal: 0);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(0),
      child: _buildExamQuestionContent(context),
    );
  }

  // ignore: unused_element
  Widget _getDivider() {
    return Container(
        padding: const EdgeInsets.only(top: 10, bottom: 10),
        child: const Divider(
          height: 1,
          color: Colors.grey,
        ));
  }

  Widget _buildExamQuestionContent(BuildContext context) {
    controller.saveAnswer = questionStepBody.item?.answer;
    return Obx(() {
      // ignore: unused_local_variable
      var currentQuestionStepIndex = controller.currentQuestionStepIndex.value;
      var head = questionStepBody.item?.head;
      String show = head?.show ?? '';
      String headText = head?.text ?? '';
      Log.debug('ExamQuestionPage _buildExamQuestionContent');
      Log.debug('questionStepBody ${questionStepBody.item?.toJson()}');
      List<Widget> examQuestionContents = [];

      if (show.indexOf(QuestionContent.QUESTION_SHOW_TYPE_IMAGE) > -1) {
        examQuestionContents.add(BGExamImageWidget(imgUrl: head?.image, source: 'Content'));
        examQuestionContents.add(SizedBox(height: 15));
      }
      if (show.indexOf(QuestionContent.QUESTION_SHOW_TYPE_AUDIO) > -1) {
        examQuestionContents.add(SampleAudioPlayer(
          name: 'audioPlayerQuestionLevel',
          audioUrl: head?.audio ?? '',
        ));
        examQuestionContents.add(SizedBox(height: 15));
      }
      if (show.indexOf(QuestionContent.QUESTION_SHOW_TYPE_TEXT) > -1) {
        examQuestionContents.add(Container(
          alignment: Alignment.centerLeft,
          child: HtmlWidget(headText,
              textStyle: TextStyle(
                  fontSize: 20,
                  color: (Get.isDarkMode ? Color(0xFF757575) : Colors.black87),
                  height: 1.8,
                  fontWeight: FontWeight.bold,
                  wordSpacing: 1.5)),
        ));
      }

      Log.debug('questionStepBody.item?.type= ${questionStepBody.item?.type}');
      if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_OPTION) {
        examQuestionContents.add(_buildQuestionOption(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_SPEAK) {
        examQuestionContents.add(_buildQuestionSpeak(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_JUDGE) {
        examQuestionContents.add(_buildQuestionOption(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_MATCH) {
        examQuestionContents.add(_buildQuestionMatch(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_GROUP) {
        examQuestionContents.add(_buildQuestionMatch(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_SORT) {
        examQuestionContents.add(_buildQuestionSort(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_INPUT || questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_FILL) {
        examQuestionContents.add(_buildQuestionInput(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_WRITE) {
        examQuestionContents.add(_buildQuestionWrite(questionStepBody.item));
      } else if (questionStepBody.item?.type == QuestionItem.QUESTION_TYPE_SPEECH) {
        examQuestionContents.add(_buildQuestionSpeak(questionStepBody.item));
      }
      Widget partContent = SingleChildScrollView(
        child: Container(
          padding: const EdgeInsets.only(left: 20, top: 0, right: 20, bottom: 0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: examQuestionContents,
          ),
        ),
      );

      return partContent;
    });
  }

  Container _buildQuestionOption(QuestionItem? questionItem) {
    List<Widget> options = [];
    RxList boxList = [].obs;
    if (controller.saveAnswer != null && controller.saveAnswer!.isNotEmpty) {
      if (questionItem != null && questionItem.answerCount != null && questionItem.answerCount! > 1) {
        boxList.addAll(controller.saveAnswer!);
      } else {
        radioGroupValue.value = controller.saveAnswer![0];
      }
    }
    if (questionItem?.body != null && questionItem?.body?.first != null) {
      List questionBodyList = questionItem?.body?.first ?? [];
      questionBodyList.sort((a, b) => a.baseValue.compareTo(b.baseValue));
      for (var iQuestionBody = 0; iQuestionBody < questionBodyList.length; iQuestionBody++) {
        QuestionContent questionBody = questionBodyList[iQuestionBody];
        if (questionItem != null && questionItem.answerCount != null && questionItem.answerCount! > 1) {
          // CheckboxListTile
          options.add(
            CheckboxListTile(
                value: boxList.contains(questionBody.baseValue!),
                controlAffinity: ListTileControlAffinity.leading,
                title: Text(questionBody.text ?? ''),
                onChanged: (isChecked) => onBoxOptionChanged(questionBody.baseValue, isChecked!, boxList)),
          );
        } else {
          options.add(RadioListTile<String>(
              value: questionBody.baseValue ?? '',
              groupValue: radioGroupValue.value,
              onChanged: onOptionChanged,
              title: _buildOptionContent(questionBody),
              // subtitle: Text(''),
              //右侧图标
              selected: radioGroupValue.value == questionBody.baseValue,
              contentPadding: answerRadioEdgeInsetsGeometry));
        }
      }
    }
    return Container(
      child: Column(
        children: options,
      ),
    );
  }

  Container _buildQuestionMatch(QuestionItem? questionItem) {
    List<Widget> options = [];
    if (questionItem?.body != null && questionItem?.body?.first != null && questionItem?.body?[1] != null) {
      List<QuestionContent> leftList = <QuestionContent>[].obs;
      List<QuestionContent> rightList = <QuestionContent>[].obs;
      List<QuestionContent> acceptedList = <QuestionContent>[].obs;
      leftList = questionItem?.body?.first ?? [];
      List<QuestionContent> tempRList = questionItem?.body?[1] ?? [];
      List<QuestionContent> tempRightList = [];
      for (int i = 0; i < tempRList.length; i++) {
        QuestionContent body1 = tempRList[i];
        rightList.add(body1);
        tempRightList.add(body1);
      }
      for (int i = 0; i < leftList.length; i++) {
        QuestionContent body2 = QuestionContent();
        body2.baseValue = '';
        body2.show = null;
        body2.text = '';
        body2.image = '';
        body2.audio = '';
        acceptedList.add(body2);
      }
      if (controller.saveAnswer != null && controller.saveAnswer!.isNotEmpty) {
        for (int i = 0; i < controller.saveAnswer!.length; i++) {
          String answerStr = controller.saveAnswer![i];
          for (int j = 0; j < leftList.length; j++) {
            QuestionContent leftItem = leftList[j];
            if (answerStr.contains(leftItem.baseValue!)) {
              for (int k = 0; k < tempRList.length; k++) {
                QuestionContent rightItem = tempRList[k];
                if (answerStr.contains(rightItem.baseValue!)) {
                  acceptedList.replaceRange(j, j + 1, [rightItem]);
                  tempRightList.remove(rightItem);
                }
              }
            }
          }
        }
      }
      rightList = tempRightList;
      options.add(Expanded(
        child: Container(
          padding: EdgeInsets.only(top: 10),
          child: ListView.builder(
            physics: NeverScrollableScrollPhysics(),
            itemCount: leftList.length,
            shrinkWrap: true,
            itemBuilder: (context, index) {
              return DragTarget<QuestionContent>(
                builder: (BuildContext context, List<dynamic> accepted, List<dynamic> rejected) {
                  return Container(
                    height: 150,
                    alignment: Alignment.centerLeft,
                    margin: EdgeInsets.only(bottom: 15),
                    child: Row(
                      children: [
                        _buildDragTarget(leftList[index], index + 1, false),
                        SizedBox(width: 10),
                        Draggable<QuestionContent>(
                          onDragCompleted: () {
                            _matchAnswer(leftList, acceptedList);
                          },
                          data: acceptedList[index],
                          child: _buildDraggable(acceptedList[index], false),
                          feedback: acceptedList[index].show == null ? SizedBox(height: 150, width: 150) : _buildDraggable(acceptedList[index], true),
                          childWhenDragging:
                              acceptedList[index].show == null ? _buildDraggable(acceptedList[index], false) : SizedBox(height: 150, width: 150),
                        )
                      ],
                    ),
                  );
                },
                onWillAccept: (QuestionContent? body) {
                  if (body?.show == null) {
                    return false;
                  }
                  return true;
                },
                onAccept: (QuestionContent body) {
                  for (int i = 0; i < acceptedList.length; i++) {
                    QuestionContent acBody = acceptedList[i];
                    if (body.baseValue == acBody.baseValue) {
                      acceptedList.replaceRange(i, i + 1, [acceptedList[index]]);
                    }
                  }
                  acceptedList.replaceRange(index, index + 1, [body]);
                },
              );
            },
          ),
        ),
      ));
      options.add(Container(
        padding: EdgeInsets.only(top: 10),
        width: 150,
        child: ListView.builder(
          physics: NeverScrollableScrollPhysics(),
          itemCount: rightList.length,
          shrinkWrap: true,
          itemBuilder: (context, index) {
            return Draggable<QuestionContent>(
              onDragCompleted: () {
                rightList.replaceRange(index, index + 1, []);
                _matchAnswer(leftList, acceptedList);
              },
              data: rightList[index],
              child: _buildDraggable(rightList[index], false),
              feedback: _buildDraggable(rightList[index], true),
              // ignoringFeedbackSemantics: false,
              childWhenDragging: SizedBox(height: 150, width: 150),
            );
          },
        ),
      ));
    }
    return Container(
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: options,
      ),
    );
  }

  _matchAnswer(List leftList, List acceptedList) {
    controller.saveAnswer?.clear();
    for (int i = 0; i < leftList.length; i++) {
      QuestionContent leftBody = leftList[i];
      QuestionContent acceptedBody = acceptedList[i];
      if (acceptedBody.show != null) {
        String answerStr = leftBody.baseValue! + '|' + acceptedBody.baseValue.toString();
        print(answerStr);
        controller.saveAnswer?.add(answerStr);
      }
    }
  }

  Widget _buildDraggable(QuestionContent body, bool isFeedback) {
    List<Widget> options = [];
    String? show = body.show;
    if (show != null) {
      if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_TEXT)) {
        options.add(isFeedback
            ? Material(
                child: Container(width: 150, height: 150, alignment: Alignment.center, child: Text(body.text ?? '', style: TextStyle(fontSize: 16))))
            : Container(width: 150, height: 150, alignment: Alignment.center, child: Text(body.text ?? '', style: TextStyle(fontSize: 16))));
      }
      if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_AUDIO)) {
        options.add(Material(
            child: IconButton(
          iconSize: 44,
          icon: const Icon(
            Icons.play_circle,
            color: Colors.blue,
          ),
          onPressed: () {
            BGSinglePlayer().play(body.audio);
          },
        )));
      }
      if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_IMAGE)) {
        options.add(BGExamImageWidget(imgUrl: body.image, source: 'MatchItem'));
      }
    } else {
      options.add(Container(
          width: 150, height: 150, margin: EdgeInsets.only(bottom: 5), decoration: BoxDecoration(border: Border.all(width: 1, color: Colors.red))));
    }
    return Row(children: options);
  }

  Widget _buildDragTarget(QuestionContent body, int index, bool isFeedback) {
    List<Widget> options = [];
    String? show = body.show;
    options.add(Text('$index. ', style: TextStyle(fontSize: 18)));
    if (show != null) {
      if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_TEXT)) {
        options.add(isFeedback
            ? Material(
                child: Container(width: 150, height: 150, alignment: Alignment.center, child: Text(body.text ?? '', style: TextStyle(fontSize: 16))))
            : Container(width: 150, height: 150, alignment: Alignment.center, child: Text(body.text ?? '', style: TextStyle(fontSize: 16))));
      }
      if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_AUDIO)) {
        options.add(Material(
            child: IconButton(
          iconSize: 44,
          icon: const Icon(
            Icons.play_circle,
            color: Colors.blue,
          ),
          onPressed: () {
            BGSinglePlayer().play(body.audio);
          },
        )));
      }
      if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_IMAGE)) {
        options.add(BGExamImageWidget(imgUrl: body.image, source: 'MatchItem'));
      }
    }
    return Row(children: options);
  }

  Container _buildQuestionSort(QuestionItem? questionItem) {
    List<Widget> options = [];
    if (questionItem?.body != null && questionItem?.body?.first != null) {
      RxList<QuestionContent> sortList = <QuestionContent>[].obs;
      List<QuestionContent> tempSortList = [];
      sortList.value = questionItem?.body?.first ?? [];
      if (controller.saveAnswer != null && controller.saveAnswer!.isNotEmpty) {
        String tempAnswerStr = controller.saveAnswer!.first;
        List<String> tempAnswerList = tempAnswerStr.split('|');
        if (tempAnswerList.length == sortList.length) {
          for (int i = 0; i < tempAnswerList.length; i++) {
            String singleStr = tempAnswerList[i];
            for (int j = 0; j < sortList.length; j++) {
              if (singleStr == sortList[j].baseValue) {
                tempSortList.add(sortList[j]);
              }
            }
          }
          sortList.clear();
          sortList.addAll(tempSortList);
        }
      }
      options.add(Expanded(
          child: ReorderableListView(
              // shrinkWrap:true,
              scrollDirection: Axis.horizontal,
              // physics: NeverScrollableScrollPhysics(),
              children: sortList.map((body) => _buildSortText(body)).toList(),
              onReorder: (int oldIndex, int newIndex) {
                print("$oldIndex --- $newIndex");
                if (oldIndex < newIndex) {
                  newIndex -= 1;
                }
                final element = sortList.removeAt(oldIndex);
                sortList.insert(newIndex, element);
                controller.saveAnswer?.clear();
                String answerStr = sortList[0].baseValue ?? '';
                for (int i = 1; i < sortList.length; i++) {
                  answerStr += '|' + sortList[i].baseValue!;
                }
                print(answerStr);
                controller.saveAnswer?.add(answerStr);
                sortList.refresh();
              })));
    }
    return Container(
      width: double.infinity,
      height: 60,
      margin: const EdgeInsets.only(top: 20),
      child: Column(children: options),
    );
  }

  Widget _buildSortText(QuestionContent body) {
    return Material(
        key: ValueKey(body),
        child: Card(
          color: Colors.white,
          shadowColor: Color(0xff9a9a9a),
          child: Container(
              padding: EdgeInsets.all(10),
              alignment: Alignment.center,
              decoration: BoxDecoration(border: Border.all(width: 1, color: Color(0xff9a9a9a))),
              child: Text(body.text!, style: TextStyle(fontSize: 20))),
        ));
  }

  TextEditingController _writeController(QuestionItem? questionItem) {
    List<String>? answer = questionItem?.answer;
    String writeText = '';
    if (answer != null && answer.isNotEmpty) {
      writeText = answer[0];
    }
    TextEditingController writeController = TextEditingController(text: writeText);
    writeController.addListener(() {
      controller.saveAnswer?.clear();
      controller.saveAnswer?.add(writeController.text);
    });
    return writeController;
  }

  Container _buildQuestionInput(QuestionItem? questionItem) {
    List<Widget> options = [];
    List<String>? answerList = [];
    int? answerCount = questionItem?.answerCount ?? 0;
    if (answerCount > 0) {
      if (controller.saveAnswer != null && controller.saveAnswer!.isNotEmpty) {
        answerList = controller.saveAnswer!;
      }
      while (answerList.length < answerCount) {
        answerList.add('');
      }
      for (int i = 0; i < answerCount; i++) {
        options.add(SizedBox(
            width: (MediaQuery.of(Get.context!).size.width - 120) * 0.5,
            child: TextField(
              controller: TextEditingController(text: answerList[i]),
              textAlign: TextAlign.center,
              onChanged: (value) {
                answerList!.replaceRange(i, i + 1, [value]);
                controller.saveAnswer = answerList;
              },
              decoration: InputDecoration(icon: Text('[${i + 1}]')),
            )));
      }
    }

    return Container(
      width: double.infinity,
      margin: const EdgeInsets.only(top: 20),
      child: Wrap(spacing: 10, runSpacing: 30, alignment: WrapAlignment.spaceBetween, children: options),
    );
  }

  Container _buildQuestionWrite(QuestionItem? questionItem) {
    List<Widget> options = [
      TextField(
        controller: _writeController(questionItem),
        maxLines: 100,
        minLines: 15,
        decoration: InputDecoration(
          border: OutlineInputBorder(borderRadius: BorderRadius.circular(5)),
          hintText: 'Writing...',
        ),
      ),
    ];

    return Container(
      padding: const EdgeInsets.only(top: 20),
      child: Column(
        children: options,
      ),
    );
  }

  Container _buildQuestionSpeak(QuestionItem? questionItem) {
    List<Widget> options = [];
    List<String>? answer = questionItem?.answer;
    String recordUrl = '';
    RxBool isShowReference = false.obs;
    String show = '';
    if (answer != null && answer.isNotEmpty && answer[0].isNotEmpty) {
      recordUrl = answer[0];
    }
    /* BGRecorder 使用说明
    *  @required  getFileId        保存成功后获取fileId
    *  @option    audioUrl         player的播放地址,支持url、localPath、fileId
    *             getLocalPath     获取录音本地存储路径
    *             getDeleteAction  获取删除事件
    * */

    options.add(BGRecorder(
        audioUrl: recordUrl,
        getFileId: (fileId) {
          controller.saveAnswer?.clear();
          controller.saveAnswer?.add(fileId);
        },
        getLocalPath: (localPath) {
          controller.saveAnswer?.clear();
          controller.saveAnswer?.add(localPath);
        },
        getDeleteAction: () {
          controller.saveAnswer?.clear();
          controller.saveAnswer?.add('delete:');
        }));

    if (questionItem?.reference != null && questionItem?.reference!.show != null) {
      show = questionItem?.reference!.show ?? '';
    }
    if (show.isNotEmpty) {
      options.add(SizedBox(height: 15));
      options.add(tipsTextWidget('Please click save, otherwise your recording will be deleted.'.tr));
      options.add(MaterialButton(
          child: Text('Reference Answer'.tr),
          color: Theme.of(Get.context!).colorScheme.secondary,
          onPressed: () {
            isShowReference.value = !isShowReference.value;
          }));
      options.add(SizedBox(height: 15));
      options.add(tipsTextWidget('Click to see the Reference Answer and improve your speaking skills.'.tr));
    }
    options.add(Obx(() {
      return Visibility(
          visible: isShowReference.value,
          child: BGDashedRectWidget(
              child: Container(
                  margin: EdgeInsets.fromLTRB(20, 20, 0, 20),
                  width: MediaQuery.of(Get.context!).size.width - 180,
                  child: buildReferenceWidget(show, questionItem))));
    }));

    options.add(SizedBox(height: 160));
    return Container(
      padding: const EdgeInsets.only(top: 20),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: options,
      ),
    );
  }

  Widget buildReferenceWidget(String show, QuestionItem? questionItem) {
    List<Widget> options = [];
    QuestionContent? body = questionItem?.reference;
    if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_AUDIO)) {
      options.add(SampleAudioPlayer(
        name: 'audioPlayerExam',
        audioUrl: body?.audio ?? '',
      ));
      options.add(SizedBox(height: 20));
    }
    if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_IMAGE) && body?.image != null) {
      options.add(BGExamImageWidget(imgUrl: body?.image, source: 'Reference'));
      options.add(SizedBox(height: 20));
    }
    if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_TEXT)) {
      options.add(Tooltip(
          padding: EdgeInsets.all(8), // Tooltip 内边距
          margin: EdgeInsets.all(12),
          preferBelow: false,
          waitDuration: Duration(milliseconds: 200),
          decoration: BoxDecoration(
              color: Color.fromARGB(241, 236, 241, 241), // 装饰颜色
              borderRadius: BorderRadius.circular(8)),
          richMessage: TextSpan(
            text: (body?.innerText ?? '').replaceAll('<br>', '\n'),
            style: TextStyle(fontSize: 17, height: 1.7, color: (Get.isDarkMode ? Color(0xFF757575) : Colors.black87)),
          ),
          child: HtmlWidget(body?.text ?? '',
              textStyle: TextStyle(fontSize: 18, color: (Get.isDarkMode ? Color(0xFF757575) : Colors.black87), height: 1.8, wordSpacing: 1.5))));
    }

    return Column(children: options);
  }

  Widget tipsTextWidget(String tips) {
    return Container(
      width: double.infinity,
      height: 30,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Icon(Icons.tips_and_updates_outlined, color: Colors.red, size: 18),
          SizedBox(width: 10),
          Text(
            tips,
            style: TextStyle(color: Color(0xff03b2cb)),
          )
        ],
      ),
    );
  }

  void onOptionChanged(Object? value) {
    Log.debug('onOptionChanged value=$value');
    radioGroupValue.value = value.toString();
    controller.saveAnswer?.clear();
    controller.saveAnswer?.add(radioGroupValue.value);
  }

  void onBoxOptionChanged(Object? value, bool isChecked, RxList boxList) {
    Log.debug('onBoxOptionChanged value=$value');
    String valueStr = value.toString();
    if (isChecked) {
      controller.saveAnswer?.add(valueStr);
      boxList.add(valueStr);
    } else {
      controller.saveAnswer?.remove(valueStr);
      boxList.remove(valueStr);
    }
  }
}

Widget _buildOptionContent(QuestionContent body) {
  String show = body.show ?? '';
  List<Widget> examQuestionContents = [];
  if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_TEXT)) {
    examQuestionContents.add(Text(body.text ?? ''));
  }
  if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_IMAGE) && body.image != null) {
    examQuestionContents.add(BGExamImageWidget(imgUrl: body.image, source: 'OptionItem'));
  }
  if (show.contains(QuestionContent.QUESTION_SHOW_TYPE_AUDIO)) {
    examQuestionContents.add(SampleAudioPlayer(
      name: 'audioPlayerTopicLevel',
      audioUrl: body.audio ?? '',
    ));
  }

  Widget examQuestion = Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: examQuestionContents,
  );
  return examQuestion;
}
